const mongoose = require('mongoose')
const Schema = mongoose.Schema
mongoose.connect('mongodb://localhost/blog')

const leaveWorldSchema = new Schema({
    nickname: {
        type: String,
    },
    text: {
        type: String,
    },
    date: {
        type: String,
        default: Date.now()
    },
    comment: {
        type: Array
    }
})

const LeaveWorld = mongoose.model('leaveWorld', leaveWorldSchema)
module.exports = LeaveWorld